package com.walter.controller;

import com.walter.common.PageVO;
import com.walter.common.Result;
import com.walter.entity.DayVisit;
import com.walter.model.query.DayVisitQuery;
import com.walter.service.DayVisitService;
import com.walter.util.Kv;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：ch
 * @date ：Created in 2021/5/25
 * @description：
 * @modified By：
 * @version: 1.0
 */
@RestController
@RequestMapping("api/dayVisit")
public class DayVisitController {
    @Autowired
    private DayVisitService dayVisitService;

    @PostMapping("find")
    @ApiOperation("后管 分页查询日访问记录")
    public Result<PageVO<DayVisit>> find(@RequestBody DayVisitQuery query){
        return Result.success(dayVisitService.find(query));
    }

    @GetMapping("findVisitNumInfo")
    @ApiOperation("后管 查询访问量信息")
    public Result<Kv> findVisitNumInfo(){
        return Result.success(dayVisitService.findVisitNumInfo());
    }
}
